/**
 *
 */

var app = getApp()
Page({
	data: {
		root: app.setting.att_url,
		banner: [],
		goods: [],
		pagetitle:'充值' + '-' + app.setting.title,
		bannerHeight: Math.ceil(290.0 / 750.0 * getApp().screenWidth)
	},
	onPullDownRefresh: function (){
		var the=this;
		var opt={};
		the.onLoad(opt);
		setTimeout(function(){
			wx.stopPullDownRefresh()
		},1000);
	},
	onLoad: function (options){
		var the=this;
		var diydata='';
		var footer='';
		wx.setNavigationBarTitle({'title':the.data.pagetitle});
		app.util.get(app.access,function(pagedata){
			the.setData({
				pagedata: pagedata,
			});
		});
	},
	click:function(evt){
		//用户点击事件 data.func 为方法名，data.params 为调用参数！
		var data=evt.currentTarget.dataset;
		app.util[data.func](data.params);
	},
	//提交订单
    formSubmit:function(e){
        var that = this;
        var value = e.detail.value;
		app.util.post('recharge',{'money':value.money},function(payid){
			app.util.pay(payid,function(res){		
				if(res.type=='success'){
					app.util.message(res.message);
				}else{
					app.util.message(res.message);
				}
			});
		});
    }
})